In most application scenarios of a binary tree, a search structure of a pipeline mode is used to achieve high performance. This requires that nodes in the binary tree are layered and stored by Branch (Branch refers to a set of nodes of the same depth in the binary tree) in different storage units, that is, memories, and the number of times of access to each memory is restricted.
In a current solution, if a binary tree has too many layers, the number of nodes to be stored on last several layers becomes very large, and even exceeds the capacity of an existing monolithic DDR storage component, for example, a storage structure of a binary tree of a height 25 shown in FIG. 1.
As can be seen from the structure shown in FIG. 1, for a binary tree of a fixed shape, when searching is performed, the binary tree is searched from the top down through each layer of Branch, so as to finally obtain a comparison result. In a comparing process, it is not allowed to return to a superior Branch to perform comparison again. In this way, the requirement of occupying a storage body of the last memory for storing nodes of the binary tree is four times larger than the requirement of occupying a storage body of the last but one memory for storing nodes of the binary tree. If nodes on last two layers are to be held in DDR3 chips of the same specification, respectively, for example, a memory at a preceding level is used as the storage body, it may occur that an occupancy requirement of a last level on the storage body is too huge, and the capacity of the memory at a preceding level is too small and cannot store all nodes at the last level. However, if the capacity of the memory is increased and a memory that can completely store all the nodes at the last level is used as the storage body, it may occur that many storage spaces in the memory are left when all nodes at a preceding level are stored and a utilization rate of spaces is too low.